import React, { useEffect, useState } from "react";
import styles from "./seek.module.scss";
import { Arrow, ArrowLeft } from "@react-vant/icons";
import http from "../../http";
import { useParams } from "react-router-dom";
import { useNavigate } from "react-router-dom";

const Seek: React.FC = () => {
  const { infoId } = useParams();
  console.log(infoId);
  const [DivList, setDivList] = useState<any>();
  const getDetail = async () => {
    const res: any = await http.get(
      "/health/share/information/v1/findInformation",
      {
        params: { infoId: infoId },
      }
    );
    setDivList(res.result);
  };
  useEffect(() => {
    getDetail();
  }, []);

  const navigate = useNavigate();
  return (
    <div>
      <div
        className={styles.search}
        onClick={() => {
          navigate("/deafult/home");
        }}
      >
        <ArrowLeft className={styles.ren} />
        <div className={styles.searchs}>
          <span>咨询详情页</span>
        </div>
      </div>
      <div
        className={styles.seekSearch}
        dangerouslySetInnerHTML={{ __html: DivList?.content }}
      />
    </div>
  );
};
export default Seek;
